package org.utils.util;

import java.util.Hashtable;
import java.util.ResourceBundle;

/**
 * @author Manuel EVENO
 */
public class ResourceBundleManager
{
	private static Hashtable bundles = new Hashtable();
	/**
	 * Constructor for ResourceBundleManager.
	 */
	private ResourceBundleManager()
	{
	}
	
	public static void registerBundle(String id, ResourceBundle bundle)
	{
		bundles.put(id, bundle);
	}
	
	public static String getString(String id, String key)
	{
	    if (bundles.containsKey(id))
		return ((ResourceBundle) bundles.get(id)).getString(key);
	    return '!'+id+'.'+key+'!';
	}
}
